package com.src.isec.domain.entity;

/**
 * @author liujiancheng
 * @name IsecLive
 * @class name：com.src.isec.domain.entity
 * @class describe
 * @time 2018/3/21 11:40
 * @change
 * @chang time
 * @class describe
 */

public class UserEntity {

    private final int id;
    private final String login;
    private final String avatar_url;

    public UserEntity(int id, String login, String avatar_url) {
        this.id = id;
        this.login = login;
        this.avatar_url = avatar_url;
    }

    public String getAvatarUrl() {
        if (avatar_url.isEmpty()) return avatar_url;
        return avatar_url.split("\\?")[0];
    }


    public int getId() {
        return id;
    }

    public String getLogin() {
        return login;
    }

    @Override
    public String toString() {
        return "id -> " + id + " login -> " + login;
    }


}
